<template>
    <div>
        <slidebar></slidebar>
		<div class="layui-body" style="padding-top:70px;">
			<span class="layui-breadcrumb" style="visibility: visible;margin-left: 30px;">
			  <a href="javascript:;"><router-link to="supportList">赞助商</router-link></a>
			  <span lay-separator="">/</span>
			  <a href="javascript:;"><router-link to="supportList">赞助商列表</router-link></a>
			</span>
			<div style="padding: 20px 30px;border-top: 1px solid #F0F0F0;">
				<router-link to="addsponsor" style="color: #fff;"><button class="layui-btn">新建赞助商</button></router-link>
			    <table class="layui-table" >
				  	<thead>
					    <tr>
					      <th>序号</th>
					      <th>创建时间</th>
					      <th>赞助商</th>
					      <th>操作</th>
					    </tr>
					</thead>
					<tbody>
				    	<tr v-for="">
				          <td>0</td>
					      <td>2018-11-11</td>
					      <td>会搜科技</td>
					      <td class="caozuo">
					      	<a class="edit" href="index.vue">编辑 -</a>
		                    <a class="del" v-on:click="del(index)">删除</a>
					      </td>
				    	</tr>
				   </tbody>
				</table>
				<div id="demo1" style="float: right;"></div>
			</div>
		</div>
    </div>
</template>
<script>
import slidebar from '../components/slidebar'
export default {
  name: '',
  data () {
    return {
      activityList:[],//活动列表
    }
  },
  components:{
      slidebar:slidebar
  },
  created(){
  	var that = this
  	that.$axios.get('/apis/web/v1/admin/activity/list',{params:{}}).then((res)=>{
		console.log(res)
		if(res.data.errCode == 0){
			if(res.data.data.data){
				that.activityList = []
				for(var i=0;i<res.data.data.data.length;i++){
					that.activityList.push(res.data.data.data[i])
				}
			}
			layui.laypage.render({
			    elem: 'demo1'
			    ,count: res.data.data.to //数据总数
			    ,jump: function(obj){
			      	console.log(obj)
			      	that.$axios.get('/apis/web/v1/admin/activity/list',{params:{page:obj.curr}}).then((res)=>{
						console.log(res)
						that.activityList = []
						if(res.data.data.data){
							for(var i=0;i<res.data.data.data.length;i++){
								that.activityList.push(res.data.data.data[i])
							}
						}
					})
			    }
			});
		}
	})
  },
  methods:{
  	del:function(index){
  		console.log(index,'index')
  		var that = this; 
  		layer.open({
		  content: '确定删除这个商品？'
		  ,btn: ['确定', '取消']
		  ,yes: function(index, layero){
		    console.log()
	  
//		      	this.$axios.get('/list/customer/listJoinCust',{params:{
//
//				}}).then((res)=>{
//					console.log(res)
//					layer.closeAll();
//				})
		  }
		  ,btn2: function(index, layero){
		  }
		  ,cancel: function(){ 
		    //右上角关闭回调
		    //return false 开启该代码可禁止点击该按钮关闭
		  }
		});
  	}
  }
}

</script>
<style type="text/css">
	.caozuo a{
		color: #01AAED;
		cursor: pointer;
	}
	.caozuo a:hover{
		color: #666666;
		cursor: pointer;
	}
</style>
